package cn.wolfcode.wms.web.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.wolfcode.wms.query.ProductStockQueryObject;
import cn.wolfcode.wms.service.IBrandService;
import cn.wolfcode.wms.service.IDepotService;
import cn.wolfcode.wms.service.IProductStockService;
import cn.wolfcode.wms.util.RequiredPermission;

@Controller
@RequestMapping("/productStock")
public class ProductStockController {
	@Autowired
	private IProductStockService service;
	@Autowired
	private IDepotService depotService;
	@Autowired
	private IBrandService brandService;
	
	@RequestMapping("/list")
	@RequiredPermission("库存列表")
	public String list(Model model,@ModelAttribute("qo")ProductStockQueryObject qo){
		model.addAttribute("depots", depotService.selectAll());
		model.addAttribute("brands", brandService.selectAll());
		model.addAttribute("result", service.query(qo));
		return "productStock/list";
	}
}
